
import React, { Component } from 'react';
import {Input , Button,InputNumber } from 'antd'
import 'whatwg-fetch'
import 'es6-promise'



class RecruitmentEdit extends Component{
  state={
    classify:"",
    title:""
  }
  componentDidMount(){
    let UE = window.UE;
    UE.getEditor('container', {
      autoHeightEnabled: true,
      autoFloatEnabled: true
    });
  }
  rua(){
    let UE = window.UE;
    let inputTitle = this.refs['title']
    console.log(this.state.classify)
    console.log(inputTitle.input.value)
    console.log(UE.getEditor('container').getContentTxt())
  }
  back(){
    console.log('返回上一个页面')
    window.history.back();
  }
  render() {
    function onChange(value) {
        console.log('changed', value);
        this.setState({
            classify:value
        })
    }
    
    return (
      <div className="App">
        <p style={{textAlign:"left"}}>岗位</p>
        <Input placeholder="Basic usage" size="large" id="ruarua" ref="title"></Input>
        <p style={{textAlign:"left"}}>人数</p>
        <InputNumber onChange={onChange.bind(this)} style={{float:"left"}}></InputNumber>
        <div style={{clear:"both"}}></div>
        <p style={{textAlign:"left"}}>要求</p>
        <textarea id="container" style={{height:"500px",width:"100%"}}></textarea>
        <Button onClick={this.back} style={{marginTop:'36px',float:"right",background:"#004894",color:"#fff",height:"45px",width:"120px",fontSize:"17px"}} icon='backward'>返回</Button>
        <Button onClick={this.rua.bind(this)} style={{marginTop:'36px',float:"right",marginRight:"36px",background:"#E50012",color:"#fff",height:"45px",width:"120px",fontSize:"17px"}} icon="upload">发布</Button>
      </div>
    );
  }
}

export default RecruitmentEdit;